package cn.fanyamin.service;

import java.util.List;

import cn.fanyamin.dao.BookDao;
import cn.fanyamin.dao.BookNoDbDao;
import cn.fanyamin.model.Book;

public class BookDaoService implements BookService {
    private BookDao dao;

    public BookDaoService() {
        this.dao = new BookNoDbDao();
    }

    public List<Book> getAllBooks() {
        return dao.getAllBooks();
    }

    public void updateBook(Book book) {
        dao.update(book);
    }

    public void deleteBook(Integer id) {
        dao.delete(id);
    }

    public Book getBook(Integer id) {
        return dao.getBook(id);
    }

    public void insertBook(Book book) {
        dao.insert(book);
    }}
